Skip to content

Provide a bit more accurate "reason" for debug stop. #179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

rkeithhill
Copy link
Contributor

It turns out that when the debugger stops at a function breakpoint, it isn't necessarily obvious why the debugger stopped. There is no breakpoint glyph for a function breakpoint. So if we return "function breakpoint", then VSCode will display "PAUSED ON FUNCTION BREAKPOINT" in the call stack viewlet. Hopefully that will help the user know why the debugger stopped.

See related VSCode issue - microsoft/vscode#3648

It turns out that when the debugger stops at a function breakpoint, it isn't necessarily obvious why the debugger stopped.  There is no breakpoint glyph for a function breakpoint.  So if we return "function breakpoint", then VSCode will display "PAUSED ON FUNCTION BREAKPOINT" in the call stack viewlet.  Hopefully that will help the user know why the debugger stopped.
{
debuggerStoppedReason =
e.Breakpoints[0] is CommandBreakpoint
? "function breakpoint"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this style for ternary operators, cleaner than the one I normally use.

@daviwil
Copy link
Contributor

daviwil commented Mar 4, 2016

Awesome! Looks great.

rkeithhill added a commit that referenced this pull request Mar 4, 2016
…reason

Provide a bit more accurate "reason" for debug stop.
@rkeithhill rkeithhill merged commit 609b2ac into PowerShell:master Mar 4, 2016
@rkeithhill rkeithhill deleted the rkeithhill/update-dbgstopped-reason branch March 4, 2016 04:54
@KirkMunro
Copy link

Could you please call them command breakpoints? They aren't function breakpoints, they are command breakpoints. They work for aliases, functions, cmdlets, and even executable applications.

@daviwil
Copy link
Contributor

daviwil commented Mar 4, 2016

At the protocol layer we're speaking in VS Code's terms so that we're consistent with their experience. In the core library layer we'll definitely want to call them command breakpoints for sure. We'll get all of our terminology straight as we start cleaning up the APIs for 1.0 later this year.

@rkeithhill
Copy link
Contributor Author

Yeah, we are trying to match the VSCode UI experience:

vscodefuncbreakpointbutton

This is one of those compromises you make when you're plugging into a multi-language editor like VSCode. BTW this is where the reason is used:

vscodefuncbreakpointreason

When plugging in these services into ISE, ISE would use more PowerShell specific terms.

Hmm, looking at this again I see a type in the service that I do need to rename FunctionBreakpointDetails to CommandBreakpointDetails. I'll do that later tonight.

@KirkMunro
Copy link

Since VSCode is a multi-language editor, and since some of these languages may either (a) not have functions/have functions called something else (subroutine, procedure, etc), or (b) not have function breakpoints/have function breakpoints that are called something else, maybe a suggestion should be logged against VSCode that the terminology should change to command breakpoint in order to serve all languages better.

@rkeithhill
Copy link
Contributor Author

Or perhaps VSCode could allow the extension to define a preferred alias for function breakpoints which it would honor in the UI (primarily the tooltip you get when you hover over the Breakpoints "+" button)? That could get tricky because VSCode is pushing for localization and I don't think the PowerShell extension is "there" yet.

@daviwil
Copy link
Contributor

daviwil commented Mar 4, 2016

Localization is something I'm not looking forward to...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants